package com.javachmapi.pay.enums;

/**
 * 支付类型
 */
public enum PayType {

	ALI(1,"支付宝"),
	WECHAT(2,"微信"),
	UNION(3,"银联");
	
	private Integer code;
	private String name;
	
	PayType(Integer code, String name) {
		this.name = name;
		this.code = code;
	}

	public static String getName(Integer code,String name) {
		for (PayType c : PayType.values()) {
			if (c.getCode() == code) {
				return c.name;
			}
		}
		return null;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}
}
